package org.hyf.test;

import org.hyf.bean.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import static org.junit.Assert.assertNotNull;

public class Springtest {

    @Test
    public void testSpringContext() {
        ApplicationContext context = new AnnotationConfigApplicationContext(Spring.class);
        User user = context.getBean(User.class);
        assertNotNull(user);
    }
    @Test
    public void testUserBean() {
        ApplicationContext context = new AnnotationConfigApplicationContext(Spring.class);
        User user = context.getBean(User.class);
        System.out.println(user);
    }
}